package homework;

class Date{
    int year;
    int month;
    int day;
    public Date(int year,int month,int day){
        this.year=year;
        this.month=month;
        this.day=day;
    }
    void showDate(){
        System.out.println("日期：" + year + "年" + month + "月" + day + "日");
    }
    boolean isLeapYear(){
        if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0){
            return true;
        }else{
            return false;
        }
    }
}
public class MyDate {
    public static void main(String[] args) {
        Date date = new Date(2020, 2, 29);
        date.showDate();
        if (date.isLeapYear()){
            System.out.println(2020 + "年是闰年");
        }else {
            System.out.println(2020 + "年不是闰年");
        }
    }
}
